//index.js
//获取应用实例
import Api from '../../api/api.js';
const api = new Api();
const app = getApp()

Page({
  data: {
    topH:44,
    userDetail:{},
    toolList:[{"title":"收藏","image":"/images/mine/shoucang.png"},{"title":"购物车","image":"/images/mine/chongwuche.png"},{"title":"打赏","image":"/images/mine/dashang.png"},{"title":"种草","image":"/images/mine/zhongcao.png"},{"title":"帮扶","image":"/images/mine/bangfu.png"},{"title":"认证","image":"/images/mine/renzheng.png"},{"title":"关联小程序","image":"/images/mine/guanlian.png"},{"title":"订单","image":"/images/mine/dingdan.png"}],
  },
 
  onLoad: function () {
    var top = wx.getMenuButtonBoundingClientRect().bottom;
    this.setData({
      topH:top + 10
    });
  },
  onShow(){
    this.getUserDetail();
  },
  getUserDetail(){
    var openId = wx.getStorageSync('OPEN_ID');
    this.getUserDataByOpenId(openId);
  },
  getUserDataByOpenId(openId) {
    var _this = this;
    var map = {};
    map.appId = app.APP_ID;
    map.openId = openId;
    api.getRequestDataNoLoading(app.getUserDataByOpenIdUrl, map, false, "GET").then(res => {
      console.log("=====",JSON.stringify(res));
      _this.setData({
        userDetail:res
      });

    });
  },
  // 
  goToMineShouCang(){
    wx.navigateTo({
      url: '/pages/mine/mineCollection/mineCollection?source=collection',
    })
  },
  goToRengZheng(){
    wx.navigateTo({
      url: '/pages/mine/renZheng/renZheng',
    })
  },
  mineBangFuClick(){
    wx.navigateTo({
      url: '/pages/mine/minebangfu/minebangfu',
    })
  },
  toToMineYouLiao(){
    wx.navigateTo({
      url: '/pages/mine/mineYouliao/mineYouliao',
    })
  },
  goToMineFollow(){
    wx.navigateTo({
      url: '/pages/mine/mineFollow/mineFollow',
    })
  },
  goToMineFans(){
    wx.navigateTo({
      url: '/pages/mine/mineFans/mineFans',
    })
  },
  goToDaShang(){
    wx.navigateTo({
      url: '/pages/mine/mineDashang/mineDashang',
    })
  },
  goToShopCart(){
    wx.navigateTo({
      url: '/pages/mine/shopCart/shopCart',
    })
  },
  goToZhongCao(){
    wx.navigateTo({
      url: '/pages/mine/minezhongcao/minezhongcao',
    })
  },
  goToMineOrder(){
    wx.navigateTo({
      url: '/pages/mine/mineOrder/mineOrder',
    })
  },
  goToEdieData(){
    wx.navigateTo({
      url: '/pages/mine/mineData/mineData',
    })
  },
})
